<template>
	<div class="takeAlap">
		<web-view :src="src" @message="messaged"></web-view>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				src: null,
				Files: {}
			};
		},
		onLoad(option) {
			uni.setNavigationBarTitle({
				title: "上传照片",
			});
			this.src = "https://yunlzz.com.cnwxh5/takepicture?token=" + uni.getStorageSync("wechatInfo").token;
		},
		mounted() {},
		methods: {
			messaged(e) {
				let par = e.target.data[0]
				if (par.action == 'pic') {
					this.Files = par.data.Files
				}
			},
		},

		onUnload() {
			if (this.Files.path) {
				uni.$emit('picUpdata', this.Files); // 触发自定义事件，并传递参数
			}

		},
	};
</script>

<style scoped>
	page {
		width: 100%;
		height: 100%;
	}

	.takeAlap {
		height: 100%;
		width: 100%;
		padding-top: 200px;
	}
</style>